1) Field of the Invention
The present invention relates to a moving picture coding method and a moving picture coding apparatus and computer program product that select any one of a plurality of modes to perform coding.
2) Description of the Related Art
In conventional international standards of moving picture coding schemes such as MPEG-2 (Moving Picture Experts Group phase 2), MPEG4, and H.264, a plurality of modes are present as methods of selecting a reference image and a method of generating a block shape and a prediction error signal. Of the modes, a scheme that selects one coding mode for each pixel block to perform coding is employed.
In these moving picture coding methods, an optimum coding mode is preferably performed in coding. That is, it is preferable to select a coding mode with best coding efficiency, and quality of the reproduced image depends on this selection. More specifically, when an optimum coding mode is not selected, image quality obtained when coding is performed at the same bit rate is deteriorated than that obtained when an optimum coding mode is selected, or an amount of code required to reproduce in the same image quality disadvantageously increases.
Therefore, it is important to appropriately select a coding mode for each pixel block. A conventional technique related to a mode selection method is proposed as follows:                First conventional mode selection: Method of selecting a coding mode which achieves a small prediction error (see Japanese Patent Application Laid-Open No. 2003-153280).        Second conventional mode selection: Method of estimating an amount of generated code based on a prediction error signal or the like and selecting a coding mode in which the estimated amount of generated code is minimum (see Japanese Patent Application Laid-Open No. H10-290464).        Third conventional mode selection: Method of trying to actually perform coding for each coding mode to select a coding mode that achieves the minimum amount of code (see Japanese Patent Application Laid-Open Nos. 2003-153280 and H9-322176).        Fourth conventional mode selection: In addition to Third conventional mode selection, method of calculating coding distortion in each coding mode, i.e., an error between a decoded image and an original image to select an optimum coding mode with respect to a balance between an amount of generated code and a coding distortion (see Thomas Wiegand and Berand Girod, “Multi-frame motion-compensated prediction for video transmission”, Kluwer Academic Publishers 2001).        
However, in First and Second conventional mode selection, a coding mode is selected based on estimation or prediction. Therefore, the selection may not be appropriate, and coding may not be performed highly efficiently.
In contrast to this, in Third and Fourth conventional mode selection, selection is performed based on a coding amount measurement result obtained by actual coding. Therefore, it is generally known that coding can be performed highly efficiently. However, in Third and Fourth conventional mode selection, coding must be actually performed in each coding mode which can be selected to measure an amount of generated code. Although coding efficiency is improved, when the number of coding modes is large, an amount of calculation required for coding and a hardware scale increase to disadvantageously increase the cost of an encoder.